<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>客户详细信息</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/global.css">
		<link rel="stylesheet" href="../../../css/style.css">
		<link href="../../../css/task.css" rel="stylesheet" />
		
		<style type="text/css">
			#div {
				width: 0px;
				height: 0px;
				background: red;
				position: fixed;
				top: 70%;
				left: 50%;
			}
		
			/*移除底部或顶部三角,需要在删除此代码*/
			.mui-popover .mui-popover-arrow:after {
				width: 0px;
			}
		</style>
		
	</head>

	<body>
		
		<div id="div"></div>
		<div id="popover" class="mui-popover shadow popover">
			<p class="title" id="title"></p>
			<div class="btn_box">
				
				<span class="fl" onclick="closepop()">取消</span>
				<span class="fr red" id="quedingupdate">拨打</span>
			</div>
		</div>
		
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">客户详细信息</h1>
		</header>
		<div class="mui-content">
			<div class="details_con">
				<div class="clum_arr">
					<span class="name_arr">用户名称</span>
					<span class="txt_arr" id="customerName"></span>
				</div>
				<div class="clum">
					<span class="name">用户类别</span>
					<span class="txt" id="enginnerType"></span>
				</div>
				<!--<div class="clum">
					<span class="name">省份-城市</span>
					<span class="txt" id="province"></span>
				</div>-->
				<div class="clum">
					<span class="name">联系人</span>
					<span class="txt" id="contact"></span>
				</div>
				<div class="clum">
					<span class="name">联系人电话</span>
					<span class="txt" id="telephone"></span>
				</div>
				<div class="clum">
					<span class="name">手机号码</span>
					<span class="txt" id="mobile"></span>
				</div>
<!--				<div class="clum">-->
<!--					<span class="name">指定工程师</span>-->
<!--					<span class="txt" id="accoutfseId"></span>-->
<!--				</div>-->
<!--				<div class="clum">-->
<!--					<span class="name">期望服务时间</span>-->
<!--					<span class="txt" id="hopeBusinessHours"></span>-->
<!--				</div>-->
<!--				<div class="clum">-->
<!--					<span class="name">完备时间</span>-->
<!--					<span class="txt" id="maturityDate"></span>-->
<!--				</div>-->
				<!--<div class="clum_arr">
					<span class="name_arr">上门地址</span>
					<span class="txt_arr" id="homeAddress"></span>
				</div>-->
			</div>
		
			<div style="height: 50px;"></div>
		</div>

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			var ServiceNoticeId
			var serviceNo
			
			(function($, doc) {
				$.init();

				
				$.plusReady(function() {
					// 从上一个页面取值
					var self = plus.webview.currentWebview();
					 // 获取上一个页面传过来的参数并显示到页面
					 ServiceNoticeId = self.ServiceNoticeId;
					 serviceNo = self.serviceNo;
					 
					 console.log("ServiceNoticeId:"+ServiceNoticeId+"	serviceNo:"+serviceNo)
					 
					 // 获取详情的方法
					 getDetails();
					 
					 // 拨打电话
					 h("#mobile").tap(function(){
						 var phone = h("#mobile").html();
						 // if(phone!='无'){
							//  let btnArray = ['拨打', '取消']; 
							//  mui.confirm('是否拨打 ' + phone + ' ？', '提示', btnArray, function(e) { 
							// 	  if (e.index == 0) { 
							// 		 plus.device.dial(phone, false); 
							// 	  }  
							//  });   
						 // }
						 if(phone!=undefined && phone!=''){
							 h("#title").html("是否拨打 " + phone + " ？");
							 mui("#popover").popover('toggle', document.getElementById("div"));
						 }					 
					 }); 
					 
					 h("#quedingupdate").tap(function(){
						 mui("#popover").popover('toggle', document.getElementById("div"));
					 	var phone = h("#mobile").html();
					 	plus.device.dial(phone, false); 
					 }) 
					 
					 
					 
					 
				});
					
			}(mui, document));
			
			// 关闭弹窗方法
			function closepop() {
				mui("#popover").popover('toggle', document.getElementById("div"));
			}
			
			// 获取详情的方法
			function getDetails(){
				ajaxGet(BASE_URL + "cc/notice/getDaiZhiPaiNoticeDetail", {
					"ServiceNoticeId": ServiceNoticeId
				}, function(data) {
					console.log(JSON.stringify(data))
					if (data.code == 200) {
						if(data.data!=""){
						
							h("#customerName").html(data.data.customerName);
							if(data.data.enginnerType==undefined || data.data.enginnerType==""){
								h("#enginnerType").html("无");
							}else{
								h("#enginnerType").html(data.data.enginnerType);
							}
							var province = "";
							if(data.data.province!=undefined && data.data.province!=""){
								province = data.data.province
							}
							if(data.data.city!=null && data.data.city!=""){
								if(province!=""){
									province = province +"-"+data.data.city
								}else{
									province = data.data.city
								}
							}
							h("#province").html(province);
							if(data.data.contact==undefined || data.data.contact==""){
								h("#contact").html("无");
							}else{
								h("#contact").html(data.data.contact);
							}
							if(data.data.telephone==undefined || data.data.telephone==""){
								h("#telephone").html("无");
							}else{
								h("#telephone").html(data.data.telephone);
							}
							if(data.data.mobile==undefined || data.data.mobile==""){
								h("#mobile").html("无");
							}else{
								h("#mobile").html(data.data.mobile);
							}
							if(data.data.accoutfseName==undefined || data.data.accoutfseName==""){
								h("#accoutfseId").html("无");
							}else{
								h("#accoutfseId").html(data.data.accoutfseName);
							}
							if(data.data.maturityDate==undefined || data.data.maturityDate==""){
								h("#maturityDate").html("无");
							}else{
								h("#maturityDate").html(data.data.maturityDate);
							}
							if(data.data.homeAddress==undefined || data.data.homeAddress==""){
								h("#homeAddress").html("无");
							}else{
								h("#homeAddress").html(data.data.homeAddress);
							}
							if(data.data.hopeBusinessHours==undefined || data.data.hopeBusinessHours==""){
								h("#hopeBusinessHours").html("无");
							}else{
								h("#hopeBusinessHours").html(data.data.hopeBusinessHours);
							}
						}
			
					}
				}, function(errorMsg) {
					console.log(JSON.stringify(errorMsg))
				});
			}
			
		</script>
		<!-- js代码 end -->

	</body>

</html>
